/*
 * @Author: cqg
 * @Date: 2020-11-12 20:32:13
 * @LastEditors: cqg
 * @LastEditTime: 2020-12-08 14:01:52
 * @Description: file content
 */
import request from "@/plugins/axios";

/**
 * 合同分页查询
 * @param {Object} query
 */
export const getContractList = query => {
    return request({
        url: "/api/collectionbill/getBillContractList",
        method: "get",
        params: query
    });
};

/**
 * 分页查询核算信息列表
 * @param {Obj} query
 */
export const getAccountList = query => {
    return request({
        url: "/api/collectionbill/page",
        method: "get",
        params: query
    });
};

//生成账单初始化
export const billInitialization = contractId => {
    return request({
        url: `/api/collectionbill/generateBillInit/${contractId}`,
        method: "get"
    });
};

//审批记录
export const getApprovalRecord = busId => {
    return request({
        url: `/api/commonapprovalrecord/${busId}`,
        method: "get"
    });
};

//查看账单
export const viewBill = billId => {
    return request({
        url: `/api/collectionbill/${billId}`,
        method: "get"
    });
};

export const generateBill = data => {
    return request({
        url: "/api/collectionbill/generateBill",
        method: "post",
        data
    });
};
// 提交
export const submit = billId => {
    return request({
        url: `/api/collectionbill/submit`,
        method: "post",
        params: { billId }
    });
};

//作废
export const abolition = billId => {
    return request({
        url: `/api/collectionbill/cancel`,
        method: "post",
        params: { billId }
    });
};
